#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;
const int P = 131;
int n, m;
string s;
ull sum[N];
ull base[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s >> m;
  n = s.size(), base[0] = 1;
  rep(i, 1, n) {
    sum[i] = sum[i - 1] * P + s[i - 1];
    base[i] = base[i - 1] * P;
  }
  rep(i, 1, m) {
    int l1, l2, r1, r2;
    cin >> l1 >> r1 >> l2 >> r2;
    ull x = sum[r1] - sum[l1 - 1] * base[r1 + 1 - l1];
    ull y = sum[r2] - sum[l2 - 1] * base[r2 + 1 - l2];
    if (x == y && r1 - l1 == r2 - l2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}